package com.yanqu.road.server.manager.union;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class CrossActivityUnionAbilityRankInfoGroup {
    private int activityId;
    private Map<Integer, CrossActivityUnionAbilityRankInfo> rankInfoMap = new ConcurrentHashMap<>();

    public CrossActivityUnionAbilityRankInfoGroup(int activityId) {
        this.activityId = activityId;
    }

    public CrossActivityUnionAbilityRankInfo getRankInfo(int groupId) {
        CrossActivityUnionAbilityRankInfo rankInfo = rankInfoMap.get(groupId);
        if (rankInfo == null) {
            synchronized (rankInfoMap) {
                rankInfo = rankInfoMap.get(groupId);
                if (rankInfo == null) {
                    rankInfo = new CrossActivityUnionAbilityRankInfo(groupId, activityId);
                    rankInfoMap.put(groupId, rankInfo);
                }
            }
        }
        return rankInfo;
    }


}
